import Vue from "vue";
import VueRouter from "vue-router";
import Login from "../views/Login.vue"
import Main from "../views/Main.vue";
import Register from "../views/Register.vue"
import RegisterTwo from "../views/RegisterTwo.vue"

import Index from "../views/Main/Index.vue";
import Message from "../views/Main/Message.vue";
import Publish from "../views/Main/Publish.vue";
import Album from "../views/Main/Album.vue";
import My from "../views/Main/My.vue";
import Pics from '../views/Main/Pics.vue'
import NewAlbum from '../views/Main/NewAlbum.vue'
import UploadPic from '../views/Pics/UploadPic.vue'

Vue.use(VueRouter);

const routes = [{
        path: '/',
        redirect: '/login',
    }, {
        path: "/login",
        name: "Login",
        component: Login,
    }, {
        path: "/register",
        name: "Register",
        component: Register,
    }, {
        path: "/registerTwo",
        name: "RegisterTwo",
        component: RegisterTwo,
    }, {
        path: '/main',
        redirect: '/index',
        meta: { auth: true, keepAlive: false }
    }, {
        path: "/main",
        name: "Main",
        component: Main,
        meta: { auth: true, keepAlive: false },
        children: [{
            path: "/index",
            name: "Index",
            component: Index,
            meta: { auth: true, keepAlive: false }
        }, {
            path: "/message",
            name: "Message",
            component: Message,
            meta: { auth: true, keepAlive: false }
        }, {
            path: "/my",
            name: "My",
            component: My,
            meta: { auth: true, keepAlive: false }
        }, {
            path: "/album",
            name: "Album",
            component: Album,
            meta: { auth: true, keepAlive: false }
        }, {
            path: "/publish",
            name: "Publish",
            component: Publish,
            meta: { auth: true, keepAlive: false }
        }]
    },
    {
        path: "/pics/:id",
        name: "Pics",
        component: Pics,
        meta: { auth: true, keepAlive: false }
    },
    {
        path: "/newAlbum",
        name: "NewAlbum",
        component: NewAlbum,
        meta: { auth: true, keepAlive: false }
    },
    {
        path: "/uploadPic",
        name: "UploadPic",
        component: UploadPic,
        meta: { auth: true, keepAlive: false }
    }
];


const router = new VueRouter({
    routes,
});

export default router;